home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / news / readers / skim-0.8 / skim-0 / skim-0.8.4 / Makefile < prev    next >
Makefile  |  1996-02-18  |  9KB  |  284 lines

  1. # INSTALLATION
  2. #    Type 'make' and follow the step-by-step instructions.
  3. # COPYRIGHT
  4. #    Skim - Off-line news reading package optimized for slow lines.
  5. #    Copyright (C) 1996  Rene W.J. Pijlman
  6. #
  7. #    This program is free software; you can redistribute it and/or modify
  8. #    it under the terms of the GNU General Public License as published by
  9. #    the Free Software Foundation; either version 2 of the License, or
  10. #    (at your option) any later version.
  11. #
  12. #    This program is distributed in the hope that it will be useful,
  13. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. #    GNU General Public License for more details.
  16. #
  17. #    You should have received a copy of the GNU General Public License
  18. #    along with this program; if not, write to the Free Software
  19. #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. # VERSION
  21. #    Skim version 0.8.4.
  22. #    $Header: /home/rene/sys/CVS_MasterSourceRepository/skim/Makefile,v 1.16 1996/02/18 11:40:19 rene Exp $
  23.  
  24. ifneq ($(SkimDevelopmentEnvironment),yes)
  25.     # Change these parameters to install skim in a different location.
  26.     PREFIX=/usr
  27.     DOC_PREFIX=/usr/doc
  28. else
  29.     PREFIX=$(HOME)
  30.     DOC_PREFIX=$(HOME)/doc
  31. endif
  32.  
  33. # Skim executables will be installed in this directory.
  34. BINDIR = $(PREFIX)/bin
  35. DOCDIR=$(DOC_PREFIX)/skim-0.8.4
  36.  
  37. README = README
  38. DOCS = $(README) skim.lsm
  39.  
  40. CC=gcc
  41. RM=rm -f
  42.  
  43. ifeq ($(SkimDevelopmentEnvironment),yes)
  44.     CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes -g -pipe -m486 \
  45.              -DDEBUG
  46. else
  47.     # Must use -fno-strength-reduce with -O2, to work around a bug in gcc.
  48.     CFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes \
  49.              -O2 -fno-strength-reduce -fomit-frame-pointer -pipe -m486 \
  50.          -s -DNDEBUG
  51. endif
  52.  
  53. BINARIES = ConstructArticle \
  54.        GetSubjectsOfNewArticlesInGroup \
  55.            PostArticle \
  56.            GetListOfGroups \
  57.            GetSelectedArticlesInGroup \
  58.            Dispatch \
  59.            RebuildArticleIndexes
  60.  
  61. TEST_BINARIES = VarBufTest \
  62.                 AuthorParseTest \
  63.         SetTest \
  64.         ArticleTest
  65.  
  66. SCRIPTS =  skim xskim
  67.  
  68. SKIM_COMMON_OBJECTS = NNTPStream.o SkimUtils.o
  69.  
  70. BASIC_LIBRARY_OBJECTS = StandardIO.o \
  71.                         VarBuf.o \
  72.             MemAlloc.o \
  73.             Set.o
  74.  
  75. OBSOLETE_INSTALLED_FILES = GetArticlesInGroup \
  76.                            AutoSelectAndKill \
  77.                        GetSubjectsInGroup \
  78.                            SplitArticle \
  79.                NewArticle \
  80.                ReplyTo \
  81.                ListSubscribedNewsGroups
  82.  
  83. DID_YOU_KNOW = "Did you know..."
  84.  
  85. # 'all' is the default target in the development environment.
  86. ifneq ($(SkimDevelopmentEnvironment),yes)
  87. intro:
  88.     @echo
  89.     @echo "Welcome to the installation procedure of skim. Please follow"
  90.     @echo "the step-by-step installation instructions."
  91.     @echo
  92.     @echo "If you have a complete and up-to-date Linux system"
  93.     @echo "the default installation of skim should be fine. If the"
  94.     @echo "installation fails, you should check the parameters in"
  95.     @echo "Makefile. There is more information on the configuration of"
  96.     @echo "skim in the $(README)."
  97.     @echo
  98.     @echo "Start with 'make fresh'."
  99.     @echo
  100. endif
  101.  
  102. all: .depend $(BINARIES) next_is_make_test
  103.  
  104. fresh: cleanup next_is_depend
  105. clean: cleanup next_is_morespace
  106.  
  107. cleanup:
  108.     $(RM) $(BINARIES) $(TEST_BINARIES) $(OBSOLETE_INSTALLED_FILES) \
  109.           *.o core *.tgz .depend tags
  110.  
  111. next_is_morespace:
  112. ifneq ($(SkimDevelopmentEnvironment),yes)
  113.     @echo
  114.     @echo $(DID_YOU_KNOW)
  115.     @echo
  116.     @echo "You can save even more disk space by removing this source"
  117.     @echo "directory (rm -rf `pwd`)."
  118.     @echo
  119.     @echo "You can keep /usr/src/skim-0.8.4.tgz in case you need"
  120.     @echo "to reinstall skim later on."
  121.     @echo
  122.     @echo "Please read the README in $(DOCDIR)/$(README) for more"
  123.     @echo "information on how to configure skim and how to get started."
  124.     @echo
  125. endif
  126.  
  127. # Remove old stuff from previous versions. Install new version.
  128. install: .depend $(BINARIES)
  129.     ( cd $(BINDIR); $(RM) $(OBSOLETE_INSTALLED_FILES) )
  130.     install -dm 755 $(BINDIR)
  131.     install -m 755 $(SCRIPTS) $(BINARIES) $(BINDIR)
  132.     install -dm 755 $(DOCDIR)
  133.     install -m 644 $(DOCS) $(DOCDIR)
  134. ifneq ($(SkimDevelopmentEnvironment),yes)
  135.     @echo
  136.     @echo $(DID_YOU_KNOW)
  137.     @echo
  138.     @echo "Skim is now installed. Please read the README in"
  139.     @echo "$(DOCDIR)/$(README) for more information on"
  140.     @echo "how to configure skim and how to get started."
  141.     @echo
  142.     @echo "You can save some disk space by typing 'make clean' now."
  143.     @echo
  144. endif
  145.  
  146. uninstall:
  147.     ( cd $(BINDIR); $(RM) $(SCRIPTS) \
  148.                           $(BINARIES) \
  149.                           $(OBSOLETE_INSTALLED_FILES) )
  150.     $(RM) -r $(DOCDIR)
  151.  
  152. VarBufTest: VarBufTest.o $(BASIC_LIBRARY_OBJECTS)
  153.     $(CC) $(CFLAGS) -o $@ VarBufTest.o $(BASIC_LIBRARY_OBJECTS)
  154.  
  155. SetTest: SetTest.o $(BASIC_LIBRARY_OBJECTS)
  156.     $(CC) $(CFLAGS) -o $@ SetTest.o $(BASIC_LIBRARY_OBJECTS)
  157.  
  158. ArticleTest: ArticleTest.o $(BASIC_LIBRARY_OBJECTS) Article.o
  159.     $(CC) $(CFLAGS) -o $@ ArticleTest.o Article.o\
  160.           $(BASIC_LIBRARY_OBJECTS)
  161.  
  162. AuthorParseTest: AuthorParseTest.o SkimUtils.o \
  163.                  $(BASIC_LIBRARY_OBJECTS)
  164.     $(CC) $(CFLAGS) -o $@ AuthorParseTest.o \
  165.          SkimUtils.o \
  166.              $(BASIC_LIBRARY_OBJECTS)
  167.  
  168. ConstructArticle: ConstructArticle.o Article.o \
  169.                 $(SKIM_COMMON_OBJECTS) $(BASIC_LIBRARY_OBJECTS)
  170.     $(CC) $(CFLAGS) -o $@ ConstructArticle.o Article.o \
  171.              $(SKIM_COMMON_OBJECTS) $(BASIC_LIBRARY_OBJECTS)
  172.  
  173. GetSubjectsOfNewArticlesInGroup: GetSubjectsOfNewArticlesInGroup.o \
  174.                                  AutoSelectAndKill.o \
  175.                                  ArticleNumber.o \
  176.                  $(BASIC_LIBRARY_OBJECTS) \
  177.                  $(SKIM_COMMON_OBJECTS)
  178.     $(CC) $(CFLAGS) -o $@ GetSubjectsOfNewArticlesInGroup.o \
  179.                           AutoSelectAndKill.o \
  180.                           ArticleNumber.o \
  181.                           $(BASIC_LIBRARY_OBJECTS) $(SKIM_COMMON_OBJECTS)
  182.  
  183. GetListOfGroups: GetListOfGroups.o NNTPStream.o $(BASIC_LIBRARY_OBJECTS)
  184.     $(CC) $(CFLAGS) -o $@ GetListOfGroups.o NNTPStream.o $(BASIC_LIBRARY_OBJECTS)
  185.  
  186. GetSelectedArticlesInGroup: GetSelectedArticlesInGroup.o \
  187.                             $(SKIM_COMMON_OBJECTS) $(BASIC_LIBRARY_OBJECTS) \
  188.                             ArticleIndex.o Article.o
  189.     $(CC) $(CFLAGS) -o $@ GetSelectedArticlesInGroup.o \
  190.                             $(SKIM_COMMON_OBJECTS) $(BASIC_LIBRARY_OBJECTS) \
  191.                             ArticleIndex.o Article.o
  192.  
  193. RebuildArticleIndexes: RebuildArticleIndexes.o \
  194.                             $(SKIM_COMMON_OBJECTS) $(BASIC_LIBRARY_OBJECTS) \
  195.                             ArticleIndex.o Article.o
  196.     $(CC) $(CFLAGS) -o $@ RebuildArticleIndexes.o \
  197.                             $(SKIM_COMMON_OBJECTS) $(BASIC_LIBRARY_OBJECTS) \
  198.                             ArticleIndex.o Article.o
  199.  
  200. PostArticle: PostArticle.o $(SKIM_COMMON_OBJECTS) Article.o \
  201.              $(BASIC_LIBRARY_OBJECTS)
  202.     $(CC) $(CFLAGS) -o $@ PostArticle.o $(SKIM_COMMON_OBJECTS) \
  203.           Article.o $(BASIC_LIBRARY_OBJECTS)
  204.  
  205. Dispatch: Dispatch.o SkimUtils.o $(BASIC_LIBRARY_OBJECTS)
  206.     $(CC) $(CFLAGS) -o $@ Dispatch.o SkimUtils.o $(BASIC_LIBRARY_OBJECTS)
  207.  
  208. test: .depend $(TEST_BINARIES)
  209.     @echo -n "VarBufTest: "
  210.     @VarBufTest
  211.     @echo -n "SetTest: "
  212.     @SetTest
  213.     @echo -n "ArticleTest: "
  214.     @ArticleTest
  215.     @echo -n "AuthorParseTest: "
  216.     @AuthorParseTest
  217. ifneq ($(SkimDevelopmentEnvironment),yes)
  218.     @echo
  219.     @echo $(DID_YOU_KNOW)
  220.     @echo
  221.     @echo "You should now do 'make install'. This will remove the"
  222.     @echo "executables from old versions of skim, install the new"
  223.     @echo "executables in $(BINDIR) and install the $(README)"
  224.     @echo "in $(DOCDIR)."
  225.     @echo
  226. endif
  227.  
  228. next_is_make_test:
  229. ifneq ($(SkimDevelopmentEnvironment),yes)
  230.     @echo
  231.     @echo $(DID_YOU_KNOW)
  232.     @echo
  233.     @echo "You can do 'make test' to run a couple of builtin diagnostics."
  234.     @echo
  235.     @echo "Then you should do 'make install'. This will remove the"
  236.     @echo "executables from old versions of skim, install the new"
  237.     @echo "executables in $(BINDIR) and install the $(README)"
  238.     @echo "in $(DOCDIR)."
  239.     @echo
  240. endif
  241.  
  242. .depend:
  243. ifneq ($(SkimDevelopmentEnvironment),yes)
  244.     @echo
  245.     @echo $(DID_YOU_KNOW)
  246.     @echo
  247.     @echo First do 'make depend'.
  248.     @echo
  249.     @exit 1
  250. endif
  251.  
  252. next_is_depend:
  253. ifneq ($(SkimDevelopmentEnvironment),yes)
  254.     @echo
  255.     @echo $(DID_YOU_KNOW)
  256.     @echo
  257.     @echo "The next step is 'make depend'."
  258.     @echo
  259. endif
  260.  
  261. # Just an alias.
  262. dep: depend
  263.  
  264. # Put include file dependencies in a file.
  265. depend:
  266.     $(CPP) -M *.c > .depend
  267. ifneq ($(SkimDevelopmentEnvironment),yes)
  268.     @echo
  269.     @echo $(DID_YOU_KNOW)
  270.     @echo
  271.     @echo "The next step is 'make all'."
  272.     @echo
  273. endif
  274.  
  275. # Make tags file for vi.
  276. tags: FORCE
  277.     ctags --defines --ignore-indentation --typedefs --no-warn *.[ch]
  278. FORCE:
  279.  
  280. # include a dependency file if one exists
  281. ifeq (.depend,$(wildcard .depend))
  282. include .depend
  283. endif
  284.